﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MakeItWeb.Framework;

namespace AllNations.UI.Controls
{
    public partial class VideoIntegrationConfiguration : System.Web.UI.UserControl, IDynamicPageConfiguration
    {
        Framework.VideoIntegrationConfiguration _Config = new Framework.VideoIntegrationConfiguration();

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        string IDynamicPageConfiguration.ConfigurationSectionLabel
        {
            get { return "Video Integration Settings:"; }
        }

        void IDynamicPageConfiguration.LoadSettings(string sSettings)
        {
            _Config.Deserialize(sSettings);
            txtYouTubeKeyword.Text = _Config.YouTubeKeyword;
            txtYouTubeUserName.Text = _Config.YouTubeAuthorName;
        }

        string IDynamicPageConfiguration.SaveSettings()
        {
            _Config.YouTubeKeyword = txtYouTubeKeyword.Text.Trim();
            _Config.YouTubeAuthorName = txtYouTubeUserName.Text.Trim();
            return _Config.Serialize();
        }
    }
}